package com.aooci.ordercat.jsf.mp;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import org.primefaces.component.tabview.TabView;
import org.primefaces.event.TabChangeEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.aooci.ordercat.service.DashboardService;

//@ManagedBean
@RequestScoped
@Component
public class ManagerPanelController implements Serializable{

	private static final long serialVersionUID = 1L;
	
	@Autowired
	@Qualifier("dashboardService")
	private transient DashboardService dashboardService;
	
	private int mainTabActiveIndex = 0;
	
	public void onMainTabChangeListener(TabChangeEvent event) {
		TabView tabView = (TabView) event.getComponent();
		this.mainTabActiveIndex = tabView.getChildren().indexOf(event.getTab());
	}

	/**
	 * @return the mainTabActiveIndex
	 */
	public int getMainTabActiveIndex() {
		return mainTabActiveIndex;
	}

	/**
	 * @param mainTabActiveIndex the mainTabActiveIndex to set
	 */
	public void setMainTabActiveIndex(int mainTabActiveIndex) {
		this.mainTabActiveIndex = mainTabActiveIndex;
	}
	
}
